home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_10_sea_vol_frets.cog < prev    next >
Text File  |  1999-11-15  |  13KB  |  455 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 10_SEA_Vol_Frets.cog
  4. #
  5. # Volodnikov frets about the wonders of Meroδ
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        entered
  19.     
  20. # .................................. KEYFRAMES .................................
  21.     
  22.     keyframe    vo_armsATside=vo_stand3_arms_side.key    local
  23.     keyframe    vo_armsATback=vo_stand2_arms_back.key    local
  24.     keyframe    vo_armsATfold=vo_stand1_arms_front.key    local
  25.     keyframe    vo_sideTOfold=0vo_stand3_bd_1.key        local
  26.     keyframe    vo_foldTOside=0vo_stand1_bd_3.key        local
  27.     keyframe    vo_sideTOback=vo_stand3_bd_2.key        local
  28.  
  29.     keyframe    vo_rubHead=0vo_rubhead_1_2.key            local # 113x
  30.     keyframe    vo_gotjones=0vo_capturejones_2_3.key    local # 305x
  31.     keyframe    vo_glassesL=0vo_glassesL_3_3.key        local
  32.     keyframe    vo_handout=0vo_handoutR_2_3.key            local
  33.     keyframe    vo_bothup=0vo_bothup_3_3.key            local
  34.  
  35. # .................................. SOUNDS ....................................
  36.     
  37.     sound        vo_meroway=Se04v01.wav                    local
  38.     sound        vo_babsecret=Se04v02.wav                local
  39.     sound        vo_toodanger=Se04v03.wav                local
  40.     sound        vo_wonderthings=Se04v04a.wav            local # 5.6 sec
  41.     sound        vo_joneshistory=Se04v04b.wav            local # 11.4 sec
  42.  
  43.     sound        dr_close=sea_doors_close_c.wav            local
  44.     
  45. # ............................... ACTOR THINGS .................................
  46.  
  47.     thing        player                                    local
  48.     thing        indy                                    linkid=0
  49.     thing        volod
  50.     thing        helmsman
  51.      
  52. # .............................. OBJECT THINGS .................................
  53.  
  54.     thing        bridgedoor                                nolink
  55.     thing        bridgeswitch                            nolink
  56.  
  57. # .............................. CAMERA THINGS .................................
  58.  
  59.     thing        cam_1                                    nolink
  60.     thing        cam_2                                    nolink
  61.     thing        cam_3                                    nolink
  62. #    thing        cam_4                                    nolink
  63.     thing        cam_5                                    nolink
  64.     
  65.     thing        ct_1a                                    nolink
  66.     thing        ct_1b                                    nolink
  67.     thing        ct_2                                    nolink
  68.     thing        ct_3                                     nolink
  69.     thing        ct_4                                    nolink
  70.     thing        ct_5                                    nolink
  71.     thing        ct_6                                    nolink
  72.     
  73. # .............................. TARGET THINGS .................................
  74.  
  75.     thing        in_mk_1                                    nolink
  76.     thing        in_mk_2                                    nolink
  77.     thing        in_mk_3                                    nolink
  78.     thing        in_mk_4                                    nolink
  79.     thing        in_mk_5                                    nolink
  80.  
  81.     thing        vo_mk_1                                    nolink
  82.     thing        vo_mk_2                                    nolink
  83.     thing        vo_mk_3                                    nolink
  84.     thing        vo_mk_4                                    nolink
  85.  
  86. # ........................ OTHER ENGINE REFERENCES .............................
  87.             
  88.     sector        startvolod
  89.     sector        startscene
  90.     sector        closedDoorSector                        local
  91.  
  92.     surface        hallthold1
  93.     surface        hallthold2
  94.     surface        hallthold3
  95.     surface        bridgethold1
  96.     surface        bridgethold2
  97.     surface        bridgethold3
  98.     
  99. # ............................... VARIABLES ....................................
  100.     
  101.     vector        v_closedDoorPYR                            local
  102.     vector        v_closedDoorPosition                    local
  103.  
  104.     flex        in_rotRate                                local
  105.     flex        vo_rotRate                                local
  106.     flex        in_headRate                                local
  107.     flex        vo_headRate                                local
  108.  
  109.     flex        duration=1.5                            local
  110.  
  111.     flex        opendoor                                local
  112.     flex        closedoor                                local
  113.  
  114.     int            cutSceneState=0                            local
  115.  
  116.     int            vo_keyTrack1                            local
  117.         
  118.     int            sender                                    local
  119.     int            curSound                                local
  120.     int            curCam                                    local
  121.  
  122.     int            in_collType                                local
  123.  
  124.     sound        music0=mus_sea_volodbridge.wav            local
  125.     sound        music1=mus_gen_awechord1.wav                local
  126.  
  127.     
  128.         cog             SEA_Deck_AI     //added by JM
  129.  
  130. end
  131.  
  132. # ==============================================================================
  133.  
  134. code
  135.  
  136. # ..............................................................................
  137.  
  138. startup:
  139.  
  140.     # Pointer to Player...
  141.     player = GetLocalPlayerThing();
  142.  
  143.     # Prep actors...
  144.     SetThingFlags(indy, 0x80000);
  145.     SetThingFlags(volod, 0x80000);
  146.     in_rotRate = GetThingMaxRotVel(indy);
  147.     in_headRate = GetThingMaxHeadVel(indy);
  148.     vo_rotRate = GetThingMaxRotVel(volod);
  149.     vo_headRate = GetThingMaxHeadVel(volod);
  150.  
  151.     v_closedDoorPYR = GetThingLVecPYR(bridgedoor);
  152.     v_closedDoorPosition = GetThingPos(bridgedoor);
  153.     closedDoorSector = GetThingSector(bridgedoor);
  154.  
  155.     return;
  156.  
  157. # ..............................................................................
  158.  
  159. entered:
  160.     
  161.     if (cutSceneState > 0)
  162.     {
  163.         return;
  164.     }
  165.  
  166.     sender = GetSenderRef();
  167.  
  168.     if (sender == startvolod)
  169.     {
  170.         # Open the bridge door...
  171.         call opendoor;
  172.  
  173.         # Place Volodnikov...
  174.         ClearThingFlags(volod, 0x80000);
  175.         AISetCutSceneMode(volod);
  176.         AISetMode(helmsman, 0x2000); // so idle anim will play
  177.     }
  178.  
  179.     if (sender == startscene)
  180.     {
  181.         # Prep...
  182.         ResetCameraFOV(0, 0.0);
  183.         cutSceneState = 1;
  184.         curCam = GetCurrentCamera();
  185.         in_collType = GetCollideType(indy);
  186.                 
  187.         StartCutScene(1);
  188.                 
  189.                 SendMessage(SEA_Deck_AI, user2);    //added by JM
  190.  
  191.         SetActorFlags(player, 0x200000);
  192.         CopyPlayerHolsters(player, indy);
  193.         Sleep(1.5); # wait for indy to stand up
  194.  
  195.         SetThingflags(player, 0x80000);
  196.         CopyOrientAndPos(in_mk_1, indy);
  197.         ClearThingFlags(indy, 0x80000);
  198.         AISetCutSceneMode(indy);
  199.  
  200.         # Let actors walk thru ship door threshholds...
  201.         SetAdjoinFlags(hallthold1, 0x02);
  202.         SetAdjoinFlags(GetSurfaceAdjoin(hallthold1), 0x02);
  203.         SetAdjoinFlags(hallthold2, 0x02);
  204.         SetAdjoinFlags(GetSurfaceAdjoin(hallthold2), 0x02);
  205.         SetAdjoinFlags(hallthold3, 0x02);
  206.         SetAdjoinFlags(GetSurfaceAdjoin(hallthold3), 0x02);
  207.         SetAdjoinFlags(bridgethold1, 0x02);
  208.         SetAdjoinFlags(GetSurfaceAdjoin(bridgethold1), 0x02);
  209.         SetAdjoinFlags(bridgethold2, 0x02);
  210.         SetAdjoinFlags(GetSurfaceAdjoin(bridgethold2), 0x02);
  211.         SetAdjoinFlags(bridgethold3, 0x02);
  212.         SetAdjoinFlags(GetSurfaceAdjoin(bridgethold3), 0x02);
  213.     
  214.         # Cut to Indy advancing to the bridge door...
  215.         SetCameraLookInterp(2, 0); # no p & t
  216.         SetCameraPosInterp(2, 0); # no dolly
  217.         SetCameraFocus(2, cam_1);
  218.         SetCameraSecondaryFocus(2, ct_1a);
  219.         SetCurrentCamera(2);
  220.         SetCameraFOV(65, 0, 0.0);
  221.         Sleep(0.01);
  222.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  223.  
  224.         AISetMoveSpeed(indy, 1.0);
  225.         AISetLookThingEyeLevel(indy, in_mk_2);
  226.         AISetMoveThing(indy, in_mk_2, 0);
  227.         MoveToFrame(ct_1a, 1, 0.2);
  228.         Sleep(1.4);
  229.  
  230.         # Volodnikov: "Meroδ, lieutenant...change the world..."
  231.         curSound = PlayVoice(volod, vo_meroway, 1.0, 0);
  232.  
  233.         # Indy eavedrops on the Russian...
  234.         AIWaitForStop(indy);
  235.         SetThingMaxHeadVel(indy, 150.0);
  236.         AIEnableHeadTracking(indy, vo_mk_2);
  237.         Sleep(0.5);
  238.         AIDisableHeadTracking(indy);
  239.         SetThingMaxRotVel(indy, 100.0);
  240.         AISetLookThingEyeLevel(indy, in_mk_3);
  241.         AISetMoveThing(indy, in_mk_3, 0);
  242.  
  243.         # Pan off Indy to Volodnikov...
  244.         SetCameraInterpSpeed(2, 3.0);
  245.         SetCameraLookInterp(2, 1);
  246.         SetCameraPosInterp(2, 1);
  247.         Sleep(0.1); # was 0.01
  248.         SetCameraSecondaryFocus(2, ct_1b);
  249.         SetCameraFOV(50, 1, 3.0);
  250.         AIWaitForStop(indy);
  251.         Sleep(0.5);
  252.  
  253.         # Indy ducks back into an alcove...
  254.         SetThingMaxRotVel(indy, in_rotRate);
  255.         AISetMoveSpeed(indy, 2.0);
  256.         AISetLookThingEyeLevel(indy, in_mk_4);
  257.         AISetMoveThing(indy, in_mk_4, 0);
  258.         AIWaitForStop(indy);
  259.         AISetLookThingEyeLevel(indy, ct_1a);
  260.         Sleep(0.1);
  261.         SetThingMaxHeadVel(indy, 180.0);
  262.         AIEnableHeadTracking(indy, bridgeswitch);
  263.         PlayKey(volod, vo_bothup, 4, 0x12, 0);
  264.         Sleep(1.0);
  265.  
  266.         # Dolly out to Volodnikov...
  267.         SetCameraInterpSpeed(2, 24.0);
  268.         SetCameraFocus(2, cam_2);
  269.         SetCameraSecondaryFocus(2, ct_2);
  270.         Sleep(3.0);
  271.         vo_keyTrack1 = PlayKey(volod, vo_armsATback, 2, 0x10, 0);
  272.         PlayKey(volod, vo_sideTOback, 4, 0x12, 0);
  273.         Sleep(1.8); # was 2.0
  274.         SetCameraFOV(80, 1, 12.0);
  275.         SetThingMaxHeadVel(volod, 150.0);
  276.         AIEnableHeadTracking(volod, helmsman);
  277.         WaitForSound(curSound);
  278.         Sleep(0.5);
  279.  
  280.         # Volodnikov: "That's where the Babylonian secret lies..."        
  281.         AIEnableHeadTracking(volod, vo_mk_1);
  282.         curSound = PlayVoice(volod, vo_babsecret, 1.0, 0);        
  283.         StopKey(volod, vo_keyTrack1, 0.0);
  284.         vo_keyTrack1 = PlayKey(volod, vo_armsATfold, 2, 0x10, 0);
  285.         PlayKey(volod, vo_handout, 4, 0x12, 1);
  286.         PlayKey(volod, vo_sideTOfold, 4, 0x12, 1);
  287.         Sleep(2.5);
  288.         WaitForSound(curSound);
  289.  
  290.         # Volodnikov: "Somehow, no one has ever claimed the treasure..."
  291.         curSound = PlayVoice(volod, vo_toodanger, 1.0, 0);
  292.         StopKey(volod, vo_keyTrack1, 0.0);
  293.         vo_keyTrack1 = PlayKey(volod, vo_armsATside, 2, 0x10, 0);
  294.         PlayKey(volod, vo_foldTOside, 4, 0x12, 0);
  295.         
  296.         # Tighten frame...
  297.         Sleep(5.0);
  298.         SetCameraFOV(48, 1, 4.3);
  299.         Sleep(0.5);
  300.  
  301.         # Volodnikov... "...does the power strike the finder, like a curse?"
  302.         PlayKey(volod, vo_glassesL, 4, 0x12, 1);
  303.         StopKey(volod, vo_keyTrack1, 0.0);
  304.         vo_keyTrack1 = PlayKey(volod, vo_armsATfold, 2, 0x10, 0);
  305.         PlayKey(volod, vo_sideTOfold, 4, 0x12, 1);
  306.         WaitForSound(curSound);
  307.         Sleep(0.2);
  308.  
  309.         # Cut to Volodnikov...
  310.         SetCameraLookInterp(2, 0);
  311.         SetCameraPosInterp(2, 0);
  312.         SetCameraFocus(2, cam_3);
  313.         SetCameraSecondaryFocus(2, ct_3);
  314.         SetCameraFOV(47, 0, 0.0);
  315.  
  316.         # Volodnikov: "I wonder...capture Jones...history is on our side!"
  317.         PlayVoice(volod, vo_wonderthings, 1.0, 0); # 5.6 sec
  318.         SetCameraInterpSpeed(2, 16.0);
  319.         SetCameraLookInterp(2, 1);
  320.         Sleep(0.01);
  321.         SetCameraSecondaryFocus(2, ct_4);
  322.         SetCameraFOV(35, 1, 16.0);
  323.         StopKey(volod, vo_keyTrack1, 0.0);
  324.         vo_keyTrack1 = PlayKey(volod, vo_armsATback, 2, 0x10, 0);
  325.         PlayKey(volod, vo_rubHead, 4, 0x12, 1); # 3.76 sec
  326.         PlayKey(volod, vo_gotjones, 4, 0x12, 0); # 10.17 sec
  327.         Sleep(1.9);
  328.         PlayVoice(volod, vo_joneshistory, 1.0, 0); # 11.4 sec
  329.         Sleep(8.27);
  330.         StopKey(volod, vo_keyTrack1, 0.0);
  331.         Sleep(1.0);
  332.  
  333.         # Volodnikov turns to go...
  334.         SetThingMaxRotVel(volod, 100.0);
  335.         AIDisableHeadTracking(volod);
  336.         SetThingMaxHeadVel(volod, 200.0);
  337.         AISetLookThingEyeLevel(volod, vo_mk_2);
  338.         AIWaitForStop(volod);
  339.     
  340.         # Track Volodnikov leaving the bridge...
  341.         AttachThingToThing(ct_5, volod);    
  342. //        SetThingMaxHeadVel(volod, vo_headRate);
  343. //        SetThingMaxRotVel(volod, vo_rotRate);
  344.         AISetMoveSpeed(volod, 1.0);
  345.         AISetMoveThing(volod, vo_mk_2, 0);
  346.  
  347.         Sleep(0.5); # was 0.5
  348.         
  349.         # Cut to pick him up as he exits...
  350.         CopyOrientAndPos(in_mk_5, indy);
  351.         SetThingMaxHeadVel(indy, in_headRate);
  352.         AIEnableHeadTracking(indy, volod);
  353.         SetCameraLookInterp(2, 0);
  354.         SetCameraPosInterp(2, 0);
  355.         SetCameraFocus(2, cam_5);
  356.         SetCameraSecondaryFocus(2, ct_5);
  357.         SetCameraFOV(60, 0, 0.0);
  358.         Sleep(0.9); # was 0.5
  359.         AISetLookThingEyeLevel(volod, vo_mk_3);
  360.         AISetMoveThing(volod, vo_mk_3, 0);
  361.         Sleep(2.0); # was 0.5
  362.  
  363.  
  364.         # Hold on Indy and zoom in as V passes...
  365.         SetCameraInterpSpeed(2, 2.0);
  366.         SetCameraLookInterp(2, 1);
  367.         Sleep(0.01);
  368.         DetachThing(ct_5);
  369.         SetCameraSecondaryFocus(2, ct_6);
  370.         MoveToFrame(ct_6, 1, 0.31); # was 0.15
  371.         SetCameraFOV(20, 1, 2.5); # was 3.7
  372.  
  373.         AISetLookThingEyeLevel(volod, vo_mk_4);
  374.         AISetMoveThing(volod, vo_mk_4, 0);
  375.         Sleep(2.5);
  376.     PlaySoundLocal(music1, 1.0, 0.0, 0x0, 0);
  377.  
  378.         # Bridge door closes...
  379.         Sleep(0.5);
  380.         call closedoor;
  381.         Sleep(1.5);
  382.  
  383.         # Restore ship doors...
  384.         ClearAdjoinFlags(hallthold1, 0x02);
  385.         ClearAdjoinFlags(GetSurfaceAdjoin(hallthold1), 0x02);
  386.         ClearAdjoinFlags(hallthold2, 0x02);
  387.         ClearAdjoinFlags(GetSurfaceAdjoin(hallthold2), 0x02);
  388.         ClearAdjoinFlags(hallthold3, 0x02);
  389.         ClearAdjoinFlags(GetSurfaceAdjoin(hallthold3), 0x02);
  390.         ClearAdjoinFlags(bridgethold1, 0x02);
  391.         ClearAdjoinFlags(GetSurfaceAdjoin(bridgethold1), 0x02);
  392.         ClearAdjoinFlags(bridgethold2, 0x02);
  393.         ClearAdjoinFlags(GetSurfaceAdjoin(bridgethold2), 0x02);
  394.         ClearAdjoinFlags(bridgethold3, 0x02);
  395.         ClearAdjoinFlags(GetSurfaceAdjoin(bridgethold3), 0x02);
  396.  
  397.         # Clean up...
  398.         # StopKey(vo_keyTrack1, 0.0);
  399.         SetThingMaxRotVel(indy, in_rotRate);
  400.         SetCollideType(indy, in_collType);
  401.         CopyOrientAndPos(indy, player);
  402.         SetCameraLookInterp(2, 0);
  403.         SetCameraPosInterp(2, 0);
  404.         RestoreExtCam();
  405.         SetCurrentCamera(curCam);
  406.         ResetCameraFOV(0, 0.0);
  407.         SetThingMaxHeadVel(indy, 50.0);
  408.         AIEnableHeadTracking(indy, cam_5);
  409.         AIClearCutSceneMode(volod);
  410.         DestroyThing(volod);
  411.         Sleep(1.0); # adjust
  412.  
  413.         SetThingMaxHeadVel(indy, in_headRate);
  414.  
  415.         # TO DO: a burst of particles from IMP #3 as camera settles behind Indy
  416.  
  417.         # Restore control...
  418.         SetCollideType(bridgedoor, 3);
  419.         SetThingflags(indy, 0x80000);
  420.         ClearThingFlags(player, 0x80000);
  421.         ClearActorFlags(player, 0x200000);
  422.         AIClearCutSceneMode(indy);
  423.         EndCutScene();
  424.                 
  425.                 SendMessage(SEA_Deck_AI, user3);    //added by JM
  426.     }
  427.  
  428.     return;
  429.  
  430. # ...................................................................
  431.  
  432. opendoor:
  433.  
  434.     Rotate(bridgedoor, 90, 1, 0.1);
  435.     MoveToFrame(bridgeswitch, 1, 1.0);
  436.  
  437.     return;
  438.  
  439. # ...................................................................
  440.  
  441. closedoor:
  442.     SetCollideType(bridgedoor, 0);
  443.     Rotate(bridgedoor, -90, 1, duration);
  444.     Sleep(0.5);
  445.     PlaySoundThing(dr_close, bridgedoor, 1, 5, 10, 0);
  446.     MoveToFrame(bridgeswitch, 0, 1.0);
  447.  
  448.     # Slam it closed...
  449.     SetThingLVecPYR(bridgedoor, v_closedDoorPYR);
  450.     SetThingPosEx(bridgedoor, v_closedDoorPosition, closedDoorSector);
  451.  
  452.     return;
  453.  
  454. end
  455.